﻿using System;
using System.Data;
using System.Collections.Generic;
using FiberRMS.Model.AlarmManager;
namespace FiberRMS.BLL.AlarmManager
{
    /// <summary>
    /// 业务逻辑类ALARM_RESOURCE 的摘要说明。
    /// </summary>
    public class ALARM_RESOURCE
    {
        private readonly FiberRMS.DAL.AlarmManager.ALARM_RESOURCE dal = new FiberRMS.DAL.AlarmManager.ALARM_RESOURCE();
        public ALARM_RESOURCE()
        { }
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string RESOURCEID)
        {
            return dal.Exists(RESOURCEID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(FiberRMS.Model.AlarmManager.ALARM_RESOURCE model)
        {
            dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(FiberRMS.Model.AlarmManager.ALARM_RESOURCE model)
        {
            dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public void Delete(string RESOURCEID)
        {

            dal.Delete(RESOURCEID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public FiberRMS.Model.AlarmManager.ALARM_RESOURCE GetModel(string RESOURCEID)
        {

            return dal.GetModel(RESOURCEID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<FiberRMS.Model.AlarmManager.ALARM_RESOURCE> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List<FiberRMS.Model.AlarmManager.ALARM_RESOURCE> modelList = new List<FiberRMS.Model.AlarmManager.ALARM_RESOURCE>();
            int rowsCount = ds.Tables[0].Rows.Count;
            if (rowsCount > 0)
            {
                FiberRMS.Model.AlarmManager.ALARM_RESOURCE model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new FiberRMS.Model.AlarmManager.ALARM_RESOURCE();
                    model.RESOURCEID = ds.Tables[0].Rows[n]["RESOURCEID"].ToString();
                    model.RESOURCECNNAME = ds.Tables[0].Rows[n]["RESOURCECNNAME"].ToString();
                    model.RESOURCENAME = ds.Tables[0].Rows[n]["RESOURCENAME"].ToString();
                    modelList.Add(model);
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  成员方法
    }
}

